<?php
namespace Futures\Controller;
use Futures\Model\OrderModel;
use Think\Controller;
/**
 *  自动更新执行的控制器
 */
class GuideController extends Controller{

    public function index(){
    	$where = array('category_id' => '47','status' => '1');
    	//获取标题
		$list = M('document')->where($where)->field('id,title,cover_id')->select();
		//获取标题图片
		foreach($list as $k=>$v){
			$cover_id = $v['cover_id'];
			$cover = M('picture')->where('id='.$cover_id)->field('path')->find();
			$list[$k]['img'] = $cover['path'];
		}
		$this->assign('list',$list);
        $this->display();
    }

    public function guide_detail(){
    	//查询标题内容
		$id = $_GET['id'];
		$list = M('document_article')->where('id='.$id)->field('content')->find();
		$problem = M('document_article')->where('id=13')->field('content')->find();
		$this->assign('list',$list);
		$this->assign('problem',$problem);
        $this->display();
    }
}